Repository navigation
feat(app-shell): fold the approver's decision band on a record under approval - #34641
Conversation
…approval Ruling A: the decisions stay buttons, every other lever goes behind one menu, and a status line names the task, the step and the submitter. Both call sites (record page, request page) draw the same band. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
…hangeset The record page's approver tests read the folded levers from the band's menu; new pins cover the approver, approver+submitter, submitter-only and override-only viewers, the variant-driven split and the request page. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
|
repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB 席位核对 · L1 (seat 3, L1-a) · 2026-11-17T05:01ZL1: REWORK The code, tests and the Clause-② widening all hold. The one must-fix is paper only, the same kind as #34624's: one changed file is outside the claim's file surface. No push is needed. Once the seat posts the claim amendment, I post ACCEPT on this same head. Must-fix (paper only, no code change)
Should-fixNone. Readings that hold
Notes
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB 席位核对 · L1 delta (seat 3, L1-a) · 2026-11-17T05:04ZL1: ACCEPT Delta read
The notes of 6938968708 stay notes. Reply-in-menu departs from ruling A's wording and is suggested for the maintainer's pending-decision list; that is not an L1 bar. A later push owes a delta read. |
|
repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX Landing · 2026-11-17T05:06Z · area o3-A
State: |
Requested by Yibo Wang · project thread
repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX
Fixes #34361
Clause-②: yes (widening — new @object-ui/i18n en keys only; no metadata/schema accept set)
Metadata-protocol: none
维护者速读
ui/packages/app-shell/src/views/DeclaredActionsBar.tsx里decisionBand那段(决定哪些按钮留在外面、何时收进菜单);②ui/packages/app-shell/src/utils/approvalDecisionFold.ts(按动作声明的 variant 判断,不按名字);③ 两个调用点各加了一个foldDecisions。What changes
Ruling A (6917968848), executed as the coordinator's plan (6936836041) lays it out.
DeclaredActionsBargains a second fold,foldDecisions(the approver fold). It applies to a viewer the server says can act (viewer.can_act === true) once more than two of the bar's actions are shown:flow_route), the step's label (step_label), and the submitter (submitter_name, or the existing "You submitted this" whenviewer.is_submitteris true);variantisprimaryordangerstay buttons (todayapproval_approveandapproval_reject); the split is read off metadata (isLeadDecision), never off a name list, so an action shipped as metadata alone lands in the menu;DropdownMenuplusDeclaredActionButton asMenuItem, the same mechanism the override fold uses). The trigger is a plain outline button: the amber shield stays the override path's mark;flex-1) and the menu trigger at its end.Gates and dispatch unchanged. Every folded action keeps its own
visible,disabledand capability gates and its dialog, and sends the same request.onDrawnActionsChangesemantics unchanged. Menu actions still count as drawn: a closed menu's actions report through the same visibility probe the override fold uses. The only internal change is that the drawn-set reporter now records afalseverdict as a key too, so "every action has reported" can be read; the drawn list itself still holdstrueverdicts only.Until every action has reported its
visibleverdict, the band folds, so the usual case never paints a flat row first. With two or fewer shown, the rest stay buttons.Disjoint from the admin override fold by construction: that viewer's
can_actisfalse.foldOverrides,isOverrideOnlyViewer,data-approval-override-foldedand their tests are unchanged.Both call sites pass
foldDecisions: the business record page (RecordDetailView, beside its existingfoldOverrides) and the request page (ApprovalDecisionPanel).Deviation from ruling A's wording — reply (
approval_comment) stays in the band's menu on both pages, not in the approvals panel. Ruling 6917968848 and the card body say 回复 moves to the approvals panel or the discussion. The complaint (two stacked bars, reply in the button row) is still fixed: reply leaves the button row. Seat repo:objectstack#3 accepted the deviation on this reason; a line on [Decision] Record page under approval shows two stacked action bars (approval decisions on top, the record's own actions in the header): fold, merge, or move the approval actions? #34361 lets the maintainer ask for a panel entry later. Moving it into theRecordApprovalsPaneltimeline is more than a modest change here:record:approvals), or a right-column block whose placement depends on the page tier;ActionProviderand the request definition just to run one declared action.In the menu, reply is reachable on every layout.
Recall for an approver who also submitted: in the menu (allowed by the plan).
Waited-days hint: not added. No threshold logic for it exists in
app-shell. The only age logic is the console inbox's relative-time formatter plus an SLA due date that the record page's request row does not carry. So there was nothing to reuse, and inventing a threshold is out of scope.New
@object-ui/i18nkeys (four), in every pack:approvalsInbox.awaitingYourDecision,approvalsInbox.stepNumber,approvalsInbox.submittedByName,approvalsInbox.moreDecisionActions. en and zh-Hans are hand-written, zh-Hant is regenerated bygen:zh-hant(byte-identical to what was written), and the other packs are translated. Reused keys:approvalsInbox.submittedByYou,common.more,common.actions.Why
Ruling A: 「A 收成一条“待你审批”」 — the approver's decision actions stay in their own band above the page body, folded: a status line that names the step, 通过 and 拒绝 as the only buttons, the other decision actions in one menu; the record's header actions do not move; no protocol change.
Tests
ui/packages/app-shell/src/views/__tests__/DeclaredActionsBar.approverFold-34361.test.tsx(12 tests):flex-1on the decisions, the trigger last in the row;foldDecisionsis unchanged;ApprovalDecisionPanel, real bar) draws the same band, remind included because that page excludes nothing.ui/packages/app-shell/src/utils/approvalDecisionFold.test.ts(7 tests).RecordDetailView.approvalDeclaredActions.test.tsx: the approver's reassign, send back and request info are read from the band's menu (the override fold set this precedent for the same file). The submitter, override and fail-closed cases are untouched.DeclaredActionsBar.foldOverrides-25877.test.tsxandutils/approvalOverride.test.tsare unchanged and green.Acceptance notes
Claim surface amendment 6938979625 (area o3-A, per L1-a 6938968708): the existing test
ui/packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsxis edited (assertion edits only: three approver pins read reassign / send back / request info from the band's menu).Sticky band on scroll: not in ruling A, so not done. The coordinator's plan (6936836041) asks for the maintainer's confirmation first.
Reply in the panel: kept in the menu; reasons under What changes.
Waited-days hint: not added, because no threshold logic exists to reuse.
Docs:
ui/AGENTS.md✨ Set up Copilot instructions #2 asks for a matchingcontent/docs/frontend/page.content/docs/**is outside this card's claimed file surface, and the bar has no SDUI node type and no page that documents its props today.Hot files: feat(approvals): the approval request page shows the whole business record #34631 (审批请求页:直接显示完整的业务记录,不止「提交时的内容」里的 6 个字段 #34588, request page) rewrites
ApprovalDecisionPanel.tsx.overlap-checkreports a textual conflict with that head in this file. This PR's change there is one prop (foldDecisions) on the bar's call site, so whichever lands second keeps that one prop.Verification
All on head
48d70e28(origin/main merged at97defd60plus later; the merge brought locale-pack and app-shell changes, so the closure was rebuilt and the suites re-run after it).Build of the app-shell dependency closure
bash scripts/pm/os-verify-lock.sh -c "pnpm turbo run build --filter='@object-ui/app-shell^...' --concurrency=2 && pnpm --dir ui exec vitest run --maxWorkers=2 packages/i18n/ packages/app-shell/src/views/__tests__/DeclaredActionsBar.approverFold-34361.test.tsx packages/app-shell/src/views/__tests__/DeclaredActionsBar.foldOverrides-25877.test.tsx packages/app-shell/src/utils/approvalDecisionFold.test.ts packages/app-shell/src/utils/approvalOverride.test.ts packages/app-shell/src/views/RecordDetailView.approvalDeclaredActions.test.tsx packages/app-shell/src/views/RecordDetailView.approvalRecallGate.test.tsx packages/app-shell/src/views/approval-decision/ apps/console/src/services/approvalRequestsDataSource.decisionPage.test.tsx"Wider app-shell sweep (pre-merge tree, same diff)
pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/__tests__/ packages/app-shell/src/views/RecordDetailView.approval*.test.tsx … packages/app-shell/src/views/approval-decision/ … apps/console/src/services/approvalRequestsDataSource.decisionPage.test.tsxType check
pnpm --filter @object-ui/i18n run type-check && pnpm --filter @object-ui/app-shell run type-check(each runstsc --noEmitandtsc -p tsconfig.test.json, so the new tests are compiled):VERDICT command-exit 0.Ablation (one, on the variant split)
node scripts/ablation-replace.mjs --file ui/packages/app-shell/src/utils/approvalDecisionFold.ts --anchor "return typeof variant === 'string' && LEAD_VARIANTS.has(variant);" --replacement "return true; // ABLATION-34361" -- …vitest run …approverFold-34361.test.tsxThe six failures are exactly the tests that need a non-lead lever in the menu; the six that stayed green do not depend on the split (unchanged viewers, the two-or-fewer case, drawn-set reports).
Gates
node scripts/pm/dispatch-gates.mjs --commands: 41 derived commands, allexit 0.--ranreconciliation:41 derived, 41 run, 0 NOT-MEASURED, 0 UNRUN (a DERIVED zero — all 41 recorded an exit code). That includespnpm --dir ui exec vitest run scripts/(173 files, 5077 passed, 2 skipped).exit 0:pnpm check:changeset-fixed;pnpm --dir ui run check:i18n-keys("Every in-scope call-site key resolves against the en pack");check:i18n-drift;check:i18n-dead-keys(none of the four new keys is listed);check:new-line-citations(0 new citation(s)).pnpm --dir ui exec eslinton the six changed ts/tsx files: exit 0, 0 errors. The warnings areno-explicit-any, in the sibling suites' style.node scripts/pm/overlap-check.mjs: clean against origin/main, feat(console): the approvals queue steps from request to request and opens the next one after a decision #34624 and feat(console): phone app menu bar with pinned entries, and a starred full menu behind More #34628; textual conflict with feat(approvals): the approval request page shows the whole business record #34631 inApprovalDecisionPanel.tsx(see Acceptance notes).pnpm lint,Test UIshards,Type Check UI.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (changed files lint clean; repo-wide run is CI's)main, one pull request.packages/spectouched: not touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX